function [MutationChromes,Mutation_no]=Mutation(CrossChromes,Select_no,m_no,n_no,CUTMachineDis,Out_Memory_temp_num)
%     if Out_Memory_temp_num<=5
%     P_mutation=0.5;  %�������
%     elseif 5<Out_Memory_temp_num<=10
%      P_mutation=0.4;
%      elseif 10<Out_Memory_temp_num<=20
%       P_mutation=0.3; 
%       elseif 20<Out_Memory_temp_num<=30
%        P_mutation=0.2; 
%     else
        P_mutation=0.2; 
%     end
    Mutation_no=0; 
    MutationChromes=zeros(1,m_no+n_no);    
    for i=1:Select_no
        Temp_1=rand;  %�����Ƿ���б���
        if Temp_1<=P_mutation
            Mutation_no=Mutation_no+1;
            MutationChromes(i,:)=CrossChromes(i,:);
            %��һ���ֱ���
            Temp_2=ceil(m_no*rand); %����λ����
            if Temp_2==0 
                Temp_2=1; 
            end
            Temp_3=ceil(m_no*rand); %����λ����
            if Temp_3==0 
                Temp_3=1; 
            end
            Temp_part2=CrossChromes(i,Temp_2);
            Temp_part3=CrossChromes(i,Temp_3);
            MutationChromes(i,Temp_2)=Temp_part3;
            MutationChromes(i,Temp_3)=Temp_part2;
          
            index2=CrossChromes(i,Temp_2+m_no);
            index3=CrossChromes(i,Temp_3+m_no);

        %% Ϊpart2ѡ���Ӧ�Ļ���
        z=rand(1);
        if z>0.5
        machineAvailable=CUTMachineDis(2:end,Temp_part2); %%�ҳ���Ӧ���������õĻ��� ����
        temp=ceil((size(CUTMachineDis,1)-1)*rand);  %%���ѡ��һ̨����
 %%��ʹ�õĻ������и�ֵ
        MutationChromes(i,Temp_3+m_no)=CUTMachineDis(temp+1,index2);

        while(MutationChromes(i,Temp_3+m_no)==0)                   %%���ѡ��Ļ������ܱ�ʹ��  Ҳ����0����ѭ������ѡ��
            temp=ceil((size(CUTMachineDis,1)-1)*rand);
            MutationChromes(i,Temp_3+m_no)=CUTMachineDis(temp+1,Temp_part2);
        end
        else 
           MutationChromes(i,Temp_3+m_no)= index2;
        end
        
        %% Ϊpart3ѡ���Ӧ�Ļ���
          z=rand(1);
        if z>0.5
          machineAvailable=CUTMachineDis(2:end,Temp_part3); %%�ҳ���Ӧ���������õĻ��� ����
        temp=ceil((size(CUTMachineDis,1)-1)*rand);  %%���ѡ��һ̨����
 %%��ʹ�õĻ������и�ֵ
        MutationChromes(i,Temp_2+m_no)=CUTMachineDis(temp+1,index3);

        while(MutationChromes(i,Temp_2+m_no)==0)                   %%���ѡ��Ļ������ܱ�ʹ��  Ҳ����0����ѭ������ѡ��
            temp=ceil((size(CUTMachineDis,1)-1)*rand);
            MutationChromes(i,Temp_2+m_no)=CUTMachineDis(temp+1,Temp_part3);
        end        

            else 
           MutationChromes(i,Temp_2+m_no)= index3;
        end
       
        else 
           MutationChromes(i,:)=CrossChromes(i,:);   
        end
    end
end